package com.zhou.message.service;

import com.zhou.message.dao.Attachment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhou.message.dto.AttachmentQueryDto;
import com.zhou.message.dto.AttachmentDto;

import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lang.zhou
 * @since 2023-03-01
 */
public interface AttachmentService extends IService<Attachment> {
    int saveHead(Integer userId, byte[] data,String filePath) throws Exception;
    int getAttachCountByMd5(String md5);
    Attachment getAttachByMd5(String md5);
    Attachment getAttachByMd5(Map<String,Object> map);
    void addAttach(Attachment attach);
    void addAttachs(List<Attachment> attachs);
    int addAttachs(int sourceId,String sourceName,List<Attachment> attachs);
    //void addAttach(Attachment attach,List<Integer> userIdList);
    int updateAttach(Attachment attach);
    void updateAttachDate(int attach, Date d);
    int getUserHeaderIdBySeq(Map<String,Object> map);
    List<Attachment> findAttachmentList(String sourceName,Integer sourceId);
    List<Attachment> findAttachmentInfoList(String sourceName,Integer sourceId);

    List<Attachment> getAttachs(List<Integer> idList);
    List<Attachment> getUserAttach(Integer userId, Integer type);
    Integer getUserAttachCount(Integer userId, Integer type);
    Attachment getAttachById(Integer id);
    void deleteAttach(List<Integer> id);
    void deleteAttachByUserId(int userId);
    List<AttachmentDto> getAttachList(AttachmentQueryDto dto);
    AttachmentDto getAttachDto(Integer id);
    Attachment getVersionAttach(String version);
    InputStream getAttachStream(Integer id);
}
